8354489: Some callers of VMError::report_and_die think it can return - #32054
8354489: Some callers of VMError::report_and_die think it can return#32054Sorna-Sarathi wants to merge 4 commits into
Conversation
|
👋 Welcome back ssarathi! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@Sorna-Sarathi The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
Webrevs
|
dholmes-ora
left a comment
There was a problem hiding this comment.
Looks good but one further change requested. Thanks
| static inline void report_error(Thread* t, DWORD exception_code, | ||
| address addr, void* siginfo, void* context) { |
There was a problem hiding this comment.
Just an observation but this helper method has served no purpose since JDK-8080775 changed the VMError code back in JDK 9.
There was a problem hiding this comment.
Done. I've updated.
| @@ -240,10 +240,6 @@ void report_vm_out_of_memory(const char* file, int line, size_t size, | |||
|
|
|||
| VMError::report_and_die(Thread::current_or_null(), file, line, size, vm_err_type, detail_fmt, detail_args); | |||
| va_end(detail_args); | |||
There was a problem hiding this comment.
The va_end is also unreachable and should also be deleted.
I'm a little suprised the compiler doesn't complain about code after a noreturn method call.
There was a problem hiding this comment.
Hmm actually this occurs in a number of places, so we should either change all or none. So I think leave this for a separate issue.
There was a problem hiding this comment.
Yeah, I've already thought about that. As you said, it occurs in other functions too. So, I didn't remove here for consistency.
There was a problem hiding this comment.
I am not sure if va_end can be omitted. Could it lead to undefined behavior?
|
There are other places that need fixing not mentioned in the JBS issue e.g. there are |
|
I think this needs some discussion we have a lot of conservative use of |
tstuefe
left a comment
There was a problem hiding this comment.
This looks mostly good to me, if you remove the report_error function David mentioned.
| static inline void report_error(Thread* t, DWORD exception_code, | ||
| address addr, void* siginfo, void* context) { |
There was a problem hiding this comment.
@Sorna-Sarathi there were couple of function calls in os_windows.cpp, to the function you just removed report_error, as you see in the build-failure log. You should update those calls with VmError::report_and_die.
2ea9a00 to
4e311dc
Compare
|
@Sorna-Sarathi Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
VMError::report_and_die is [[noreturn]] and cannot return, even when UseOSErrorReporting is enabled.
Remove misleading comments and dead code from report_error(os_windows.cpp) and report_vm_out_of_memory (debug.cpp).
JBS Issue: JDK-8354489
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32054/head:pull/32054$ git checkout pull/32054Update a local copy of the PR:
$ git checkout pull/32054$ git pull https://git.openjdk.org/jdk.git pull/32054/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32054View PR using the GUI difftool:
$ git pr show -t 32054Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32054.diff
Using Webrev
Link to Webrev Comment